package com.kafka.example.kafka.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
/**
 * @author CodeDancing
 * @version 1.0
 * @date 2022/2/17 3:41 下午
 */
@Component
public class KafkaConsumer {

	private Logger log = LoggerFactory.getLogger(this.getClass());

    /**
     * kafka监听消息
     * @param message
     */
    @KafkaListener(topics = {"topic01"})
    public void consumer(String message){
        log.info("topic01 topic message : {}", message);
    }
}